import requests
import http.client

'''接口测试的模块--商品上下架接口'''

class Interface():

    def change_status(self,listpa,cookie):
        '''通过接口改变商品的状态'''
        # url = 'http://localhost/TinyShopV2.4/index.php?con=admin&act=login'
        # _data = {'name':'admin','password':'123456','verifyCode':'aaaa'}
        # res = requests.post(url,data=_data)
        # _cookies = {res.cookies.keys()[0]:res.cookies.values()[0]}
        # print(_cookies)
        URL = 'http://localhost/TinyShopV2.4/index.php?con=goods&act=set_online&status='+listpa[0]+'&id='+listpa[1]
        requests.get(URL,cookies = cookie)